using System;
using System.Web.UI.WebControls;
using Blazing.BusinessObjects.Cms;
using Blazing.UI.Cms.Admin.Classes;
using Blazing.WebFacade;

public partial class protected_ManageThemes : SiteBasePage //System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        Page.MaintainScrollPositionOnPostBack = true;
    }
    protected void LinkButtonInsert_Click(object sender, EventArgs e)
    {
        DetailsView1.Visible = true;
    }
    protected void DetailsView1_ItemCommand(object sender, DetailsViewCommandEventArgs e)
    {
        //if (e.CommandName == "Cancel" || e.CommandName == "Insert")
        //{
        //    DetailsView1.Visible = false;
        //}
    }
    protected void DetailsView1_ItemInserting(object sender, DetailsViewInsertEventArgs e)
    {
        e.Values.Add("Site", Blazing.BusinessObjects.Cms.Site.Load(SiteController.CurrentSiteId));

    }
    protected void LinkButtonInsertThemes_Click(object sender, EventArgs e)
    {
        DetailsViewTheme.Visible = true;
        GridViewThemes.EditIndex = -1;
    }
    protected void DetailsViewTheme_ItemCommand(object sender, DetailsViewCommandEventArgs e)
    {
        //if (e.CommandName == "Cancel" || e.CommandName == "Insert")
        //{
        //    DetailsViewTheme.Visible = false;
        //}
    }
    protected void GridView1_SelectedIndexChanging(object sender, GridViewSelectEventArgs e)
    {
        PanelAddTheme.Visible = true;
        //LiteralThemeTitle.Text = Masterpage.Load((int)GridView1.SelectedValue).Name;
    }
    protected void DetailsViewTheme_ItemInserting(object sender, DetailsViewInsertEventArgs e)
    {
        e.Values.Add("Masterpage", Masterpage.Load((int)GridView1.SelectedValue));
    }

    protected void LinkButtonCloseWindow_Click(object sender, EventArgs e)
    {
        PanelAddTheme.Visible = false;
    }
}
